(N/A) The atomic number of magnesium $(Mg)$ is $12$, and its electronic configuration is $2, 8, 2$. It has $2$ valence electrons.
The atomic number of chlorine $(Cl)$ is $17$, and its electronic configuration is $2, 8, 7$. It has $7$ valence electrons.
To form magnesium chloride $(MgCl_2)$, the magnesium atom loses $2$ electrons to achieve a stable octet configuration, forming a $Mg^{2+}$ ion.
Each of the two chlorine atoms gains $1$ electron from the magnesium atom to complete their octets, forming two $Cl^-$ ions.
The electron dot structure and transfer process are as follows:
$Mg: + 2 \cdot \ddot{Cl}: \rightarrow [Mg^{2+}] [: \ddot{Cl}:^-]_2$